**********************************************************
**************II Do File_20March2020**********************
**********************************************************

********************************************************
*Variable Names:
*NOTE: description (justification/data sources) of control variables in manuscript and Supplementary Appendix
**ccode = COW code
*cs_1 = Civil society (size of involvment and restrictions on participation (v2x_cspart; VDEM 2015) lagged one year
*cwar_1 = Civil war presence (Gleditsch et al. 2002) lagged one year
*gdpcaplog_1 = Logged GDP per capita (World Bank 2018) lagged one year
*iacthr_numcase_1 = Number of adverse IACtHR judgments involving physical integrity rights lagged one year
*lfdi_1 = Logged foreign direct investment (World Bank 2018) lagged one year
*lji_1 = Judicial power (Linzer & Staton 2015) lagged one year
*nhri_1 = National human rights insittution presence (Conrad et al. 2013) lagged one year
*numcaseimpk12jud_1 = Interaction of number adverse ECtHR judgments involving physical integrity rights (key, level 1, level 2 importance) and judicial power (Linzer & Staton 2015) lagged one year
*numcase_impk12_1 = Number of adverse ECtHR judgments involving physical integrity rights (key, level 1, level 2) lagged
*numcasejud_1 = Interaction of number of adverse IACtHR judgments involving physical integrity rights and judicial power (Linzer & Staton 2015) lagged one year 
*polconiii_1 = Veto (legislative opposition) (Henisz 2002) lagged one year
*popmillionslog_1 = Logged population in millions (World Bank 2018) lagged one year
*regionalcountbin_1 = Presence of one or more adverse IACtHR judgments (Hawkins & Jacoby 2010 & IACtHR website) lagged one year
*regionalcountimpk12bin_1 = Presence of one or more adverse ECtHR judgments (key, level 1, level 2) in the region (HUDOC database) lagged one year
*regionalcountart3impk12bin_1 = Presence of one or more adverse ECtHR judgment involving torture (Article 3) from key case or level 1 or level 2 importance
*repressionlatent = Fariss (2014) respect for physical integrity rights
*speech_1 = Freedom of Speech (CIRI 2014) lagged one year
*tort = Respect for the right to be free from torture (CIRI 2014)
*tort_1 = Respect for right right to be free from torture (CIRI 2014) lagged one year
*v2xel_frefair_1 = Free and fair elections (VDEM 2015) lagged one year
*xrcomp_1 = Competitiveness of executive recruitment (Polity IV - Marshall et al. 2011) lagged one year
***********************************************************
 
*1. Table 1, Column 1
*Use "ECtHRMasterData.dta" (Stata v. 15)

xtreg repressionlatent numcaseimpk12jud_1 numcase_impk12_1 lji_1 lfdi_1 speech_1 cs_1 nhri_1 polconiii_1 xrcomp_1 cwar_1 v2xel_frefair_1 popmillionslog_1 gdpcaplog_1 regionalcountimpk12bin_1, re vce(cluster ccode) level(90)

*2. Table 1, Column 2
*Use "IACtHRMasterData.dta" (Stata v. 15)
xtreg repressionlatent numcasejud_1 iacthr_numcase_1 lji_1 lfdi_1 speech_1 cs_1 nhri_1 xrcomp_1 polconiii_1 v2xel_frefair_1 popmillionslog_1 gdpcaplog_1 cwar_1 regionalcountbin_1 if ccode != 52 & ccode != 53 & ccode != 115, re vce(cluster id) level(90)

****************************************************************
*3. Figure 1, Left Cell
*Use "ECtHRMasterData.dta" (Stata v. 15)
xtreg repressionlatent i.numcase_impk12_1##c.lji_1 c.lfdi_1 i.speech_1 c.cs_1 i.nhri_1 i.xrcomp_1 c.polconiii_1 i.cwar_1 i.regionalcountimpk12bin_1 c.v2xel_frefair_1 c.popmillionslog_1 c.gdpcaplog_1, re vce(cluster ccode)
margins 1.numcase_impk12_1, at(lji_1 = (.3(.1)1) speech_1 = 1 nhri_1 = 1 xrcomp_1 = 3 cwar_1 = 0 regionalcountimpk12bin_1 = 1 (mean) lfdi_1 cs_1 polconiii_1 popmillionslog_1 gdpcaplog_1 v2xel_frefair_1)
marginsplot, recastci(rarea) level(90)

*4. Figure 1, Right Cell
*Use "IACtHRMasterData.dta" (Stata v. 15)
xtreg repressionlatent i.iacthr_numcase_1##c.lji_1 i.speech_1 c.cs_1 i.nhri_1 i.xrcomp_1 c.polconiii_1 c.lfdi_1 c.v2xel_frefair_1 i.regionalcountbin_1 i.cwar_1 c.popmillionslog_1 c.gdpcaplog_1 if ccode != 52 & ccode != 53 & ccode != 115, re vce(cluster id)
margins 1.iacthr_numcase_1, at(lji_1 = (0(.1)1) speech_1 = 1 nhri_1 = 1 xrcomp_1 = 3 cwar_1 = 0 regionalcountbin_1 = 1 (mean) cs_1 lfdi_1 polconiii_1 v2xel_frefair_1 popmillionslog_1 gdpcaplog_1)
marginsplot, recastci(rarea) level(90)

*****************************************************************
*5. Figure 2
*Use "ECtHRMasterData.dta" (Stata v. 15)

ologit tort i.art3_violimpk12bin_1##c.lji_1 c.lfdi_1 i.speech_1 c.cs_1 i.nhri_1 c.polconiii_1 i.cwar_1 i.regionalcountart3impk12bin_1 i.xrcomp_1 c.popmillionslog_1 c.gdpcaplog_1 c.v2xel_frefair_1 i.tort_1, vce(cluster ccode)
*Right Cell
margins 1.art3_violimpk12bin_1, predict(outcome(2)) at(lji_1 = (.3(.1)1) speech_1 = 1 nhri_1 = 1 cwar_1 = 0 regionalcountart3impk12bin_1 = 1 xrcomp_1 = 3 tort_1 = 2 (mean) lfdi_1 cs_1 polconiii_1 popmillionslog_1 gdpcaplog_1 v2xel_frefair_1)
marginsplot,  level(90)
*Center Cell
margins 1.art3_violimpk12bin_1, predict(outcome(1)) at(lji_1 = (.3(.1)1) speech_1 = 1 nhri_1 = 1 cwar_1 = 0 regionalcountart3impk12bin_1 = 1 xrcomp_1 = 3 tort_1 = 2 (mean) lfdi_1 cs_1 polconiii_1 popmillionslog_1 gdpcaplog_1 v2xel_frefair_1)
marginsplot,  level(90)
*Left Cell
margins 1.art3_violimpk12bin_1, predict(outcome(0)) at(lji_1 = (.3(.1)1) speech_1 = 1 nhri_1 = 1 cwar_1 = 0 regionalcountart3impk12bin_1 = 1 xrcomp_1 = 3 tort_1 = 2 (mean) lfdi_1 cs_1 polconiii_1 popmillionslog_1 gdpcaplog_1 v2xel_frefair_1)
marginsplot,  level(90)
